package com.kt.common.clazz.interface1

import com.kt.common.clazz.interface1.funinterface.KRunnable
import com.kt.common.clazz.interface1.impl.C
import com.kt.common.clazz.interface1.impl.Employee

fun main() {
//    val employee = Employee(1, 1, "jack", "ma")
//    employee.getName()
//    employee.food()
//    employee.sleep()
//    employee.think()
//    employee.byCar()

    //实现了两个接口，里边有相同的方法
    /*val c = C()
    c.bar()
    c.foo()*/
    //lambda 表达式
    /*kThread(10) {
        it * 10
    }
    kThread(20, object : KRunnable {
        override fun invoke(accept: Int): Int {
            return accept + 12
        }
    })*/
}


fun kThread(a: Int, kRunnable: KRunnable) {
    println("$a + ${kRunnable.invoke(a)} = ${a + kRunnable.invoke(a)}")
    kRunnable.doInvoke()
}